#############################
#### REPLICATION PACKAGE ####
#############################

Title: "Strangers in the Homeland? The Academic Performance of U.S.-Born Children of Return Migrants in Mexico" 
Author: Nathan I. Hoffmann
Journal: Population Research and Policy Review

#############################

This package replicates the main paper's figures and the entire Online Appendix for "Strangers in the Homeland? The Academic Performance of U.S.-Born Children of Return Migrants in Mexico," published in Population Research and Policy Review. 

I conducted all analyses in R, using RMarkdown (.Rmd) files. To run these replication files, all files should be saved in the same folder.

This package contains the following elements:
1. 1_pisa_cleaning.R: Creates the pisa_return.Rds dataset that is used for analyses. 
2. 2_main_paper.Rmd: Replicates all figures from the main paper as a Word document.
3. 3_online_appendix.RmD: Reproduces the Online Appendix.
4. word-template.docx: template used for producing the main paper document
5. readme.txt: this readme file

The user will need to download the PISA data for 2009, 2012, 2015, 2018, and 2022, saving them in the same location and replacing "datapath" in the R file with this pathname. I downloaded the 2009 and 2012 datasets in Stata format from https://www.evidin.pl/en/data/ and data for the other years in sav forma from the OECD website https://www.oecd.org/en/about/programmes/pisa/pisa-data.html




#############################

For information on the version of R and the packages I use, here is the output from sessionInfo():

R version 4.5.1 (2025-06-13)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.7.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] tcltk     stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] lubridate_1.9.4 forcats_1.0.0   stringr_1.5.1   dplyr_1.1.4     purrr_1.1.0     readr_2.1.5    
 [7] tidyr_1.3.1     tibble_3.3.0    ggplot2_4.0.0   tidyverse_2.0.0 haven_2.5.5     MatchIt_4.7.2  
[13] sensemakr_0.1.6 broom_1.0.9     cem_1.1.31      lattice_0.22-7  optmatch_0.10.8 knitr_1.50     
[19] here_1.0.1      estimatr_1.0.6  lmtest_0.9-40   zoo_1.8-14      sandwich_3.1-1  srvyr_1.3.0    
[25] patchwork_1.3.1

loaded via a namespace (and not attached):
 [1] gtable_0.3.6         xfun_0.52            rmdfiltr_0.1.5       tzdb_0.5.0          
 [5] vctrs_0.6.5          tools_4.5.1          generics_0.1.4       pkgconfig_2.0.3     
 [9] Matrix_1.7-3         RColorBrewer_1.1-3   S7_0.2.0             assertthat_0.2.1    
[13] lifecycle_1.0.4      compiler_4.5.1       farver_2.1.2         combinat_0.0-8      
[17] mitools_2.4          survey_4.4-8         htmltools_0.5.8.1    yaml_2.3.10         
[21] Formula_1.2-5        crayon_1.5.3         pillar_1.11.0        rlemon_0.2.1        
[25] nlme_3.1-168         digest_0.6.37        tidyselect_1.2.1     stringi_1.8.7       
[29] bookdown_0.43        labeling_0.4.3       splines_4.5.1        fastmap_1.2.0       
[33] rprojroot_2.1.1      grid_4.5.1           cli_3.6.5            magrittr_2.0.3      
[37] randomForest_4.7-1.2 survival_3.8-3       withr_3.0.2          scales_1.4.0        
[41] backports_1.5.0      timechange_0.3.0     rmarkdown_2.29       httr_1.4.7          
[45] chk_0.10.0           hms_1.1.3            evaluate_1.0.4       rlang_1.1.6         
[49] Rcpp_1.1.0           glue_1.8.0           DBI_1.2.3            rstudioapi_0.17.1   
[53] R6_2.6.1             texreg_1.39.4       